﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.IO;

namespace CRP.JS.Demo.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            ViewBag.Message = "Welcome to ASP.NET MVC!";

            return View();
        }

        public ActionResult JavaScript1()
        {
            return View();
        }

        public ActionResult Functions()
        {
            return View();
        }


        public ActionResult OOP()
        {
            return View();
        }


        public ActionResult Bootstrap()
        {
            return View();
        }

        public ActionResult About()
        {
            return View();
        }


        public ActionResult Submitted()
        {
            return View();
        }

        [HttpPost]
        public ActionResult Submitted(string name)
        {
            return View();
        }

        public ActionResult Closure()
        {
            return View();
        }


        public ActionResult Guide()
        {
            return View();
        }

        public ActionResult ActiveX()
        {
            string a = Guid.NewGuid().ToString();

            return View();
        }


        public ActionResult Upload()
        {

            return View();
        }

        public ActionResult ProcessUpload(string qqfile)
        {
            try
            {
                using (var inputStream = Request.InputStream)
                {
                    using (var flieStream = new FileStream(@"c:\temp\" + qqfile, FileMode.Create))
                    {
                        inputStream.CopyTo(flieStream);
                    }
                }

            }
            catch (Exception)
            {
                
                throw;
            }
            return Json(new { success = true });
        }
        
    }
}
